package com.cyf.smartCity;

import com.cyf.smartCity.bean.*;
import com.cyf.smartCity.service.PersonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@Api("智慧停管平台-会员管理")
@RequestMapping(value = "person/")
public class PersonHttpController {

    @Autowired
    private PersonService personService;


    @PostMapping("personList")
    @ApiOperation(value = "获取会员列表")
    public WechatParkListPersonRsp listPerson(@RequestBody WechatParkListPersonReq req) {
        return personService.listPerson(req);
    }

    @PostMapping("personDelete")
    @ApiOperation(value = "删除会员和车辆")
    public WechatBasicRsp deletePerson(@RequestParam Integer id) {
        return personService.deletePerson(id);
    }

//    @ApiOperation("新增/更新会员车辆信息")
//    @PostMapping(value = "addUpdatePersonCar")
//    public ApiAddUpdatePersonCarRsp addUpdatePersonCar(@RequestBody ApiAddUpdatePersonCarReq req) {
//        return personService.addUpdatePersonCar(req);
//    }

    @PostMapping("getPerson")
    @ApiOperation(value = "编辑会员和车辆")
    public WechatParkGetPersonRsp getPerson(@RequestParam Integer id) {
        return personService.getPerson(id);
    }

    @PostMapping("feeGroupList")
    @ApiOperation(value = "获取计费规则列表")
    public WechatParkListFeeGroupRsp listFeeGroup(@RequestParam Integer parkingId) {
        return personService.listFeeGroup(parkingId);
    }

    @PostMapping("person/recharge/form")
    @ApiOperation(value = "会员充值界面")
    public WechatParkPersonRechargeFormRsp personRechargeForm(@RequestBody WechatParkPersonRechargeFormReq req) {
        return personService.personRechargeForm(req);
    }
}
